package com.zbkj.crmeb.store.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.common.PageParamRequest;
import com.zbkj.crmeb.store.model.StoreOrder;
import com.zbkj.crmeb.store.model.StoreOrderInfo;
import com.zbkj.crmeb.store.request.StoreOrderInfoActivityRequest;
import com.zbkj.crmeb.store.request.StoreOrderInfoSearchRequest;
import com.zbkj.crmeb.store.vo.StoreOrderInfoVo;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;

/**
* @author Mr.Zhang
* @description StoreOrderInfoService 接口
* @date 2020-05-28
*/
public interface StoreOrderInfoService extends IService<StoreOrderInfo> {

    List<StoreOrderInfo> getList(StoreOrderInfoSearchRequest request, PageParamRequest pageParamRequest);

    HashMap<Integer, List<StoreOrderInfoVo>> getMapInId(List<Integer> orderIdList);

    /**
     * 待完成
      * @param orderIdList
     * @return
     */
    HashMap<Integer, List<StoreOrderInfoVo>> getMapInIdWaitForComplete(List<Integer> orderIdList);

    public List<StoreOrderInfoVo> getOrderListByOrderId(Integer orderId);

    List<StoreOrderInfoVo> getPickingOrderListByOrderId(Integer orderId);

    /**
     * 批量添加订单详情
     * @param storeOrderInfos 订单详情集合
     * @return 保存结果
     */
    boolean saveOrderInfos(List<StoreOrderInfo> storeOrderInfos);

    /**
     * 获取待支付和待发货商品库存
     * @param productId
     * @return
     */
    List<StoreOrderInfo>  getStoreOrderInfoList(Integer productId);

    /**
     * 获取待支付商品库存
     * @param productId
     * @return
     */
    List<StoreOrderInfo> getStoreOrderInfoListUnPaid(List<Integer> productIdList, List<Integer> activityIds);

    /**
     * 查询用户子订单列表
     * @param storeOrderPram
     * @return
     */
    List<StoreOrderInfo> getUserOrderList(StoreOrder storeOrderPram);

    List<StoreOrderInfo> getOrderCount(StoreOrder storeOrderPram);

    List<StoreOrderInfoVo> getOrderListByOrderIdTwo(Integer id);

    List<StoreOrderInfo> getChildOrderGroupByDate(String dateLimit, int lefTime,Integer merId);

    int getChildOrderCount(String date,Integer merId);

    BigDecimal getSumBigDecimal(String searchDateDay,Integer merId);

    /**
     * 统计订单金额
     * @param searchDateDay  搜索日期
     * @param merIds  商户ids
     * @return
     */
    BigDecimal getSumBigDecimalByMerIds(String searchDateDay,List<Integer> merIds);

    /**
     * 统计订单量
     * @param searchDateDay  搜索日期
     * @param merIds 商户ids
     * @return
     */
    Integer countChildOrderByMerIds(String searchDateDay,List<Integer> merIds);

    /**
     *
     * @param dateLimit
     * @param lefTime
     * @param merIds
     * @return
     */
    List<StoreOrderInfo> sumChildOrderGroupByDate(String dateLimit, int lefTime,List<Integer> merIds);

    /**
     * 净利润统计
     * @param searchDateYesterday
     * @param merIds
     * @param field
     * @return
     */
    BigDecimal getSumProfitBigDecimal(String searchDateYesterday, List<Integer> merIds, String field);

    BigDecimal getOrderPaidAmount(List<String> orders);

    /**
     * 查询活动期间用户已购买商品数量
     * @param request
     * @return java.lang.Integer
     */
    Integer getNumByActivityId(StoreOrderInfoActivityRequest request);


    List<StoreOrderInfo> getUnionAllOrderInfo(StoreOrder storeOrderPram);

    List<StoreOrderInfo> getVerifyOrderInfo(StoreOrder storeOrderPram);

}
